﻿using SIPSorcery.SIP;
using System;
using System.Net;
using System.Text;

namespace SIPSorcery.GBdemo
{
    class Program
    { 
        static void Main(string[] args)
        {
            Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
            SIPServer.SIPServer server = new SIPServer.SIPServer();
            Console.WriteLine("（1）输入 start 开启服务");
            Console.WriteLine("（2）输入 stop 关闭服务");
            Console.WriteLine("（3）输入 live 开启直播");
            Console.WriteLine("（4）输入 lives 关闭直播");
            Console.WriteLine("（5）输入 cat 查询设备信息");
            Console.WriteLine("（6）输入 rec 查询设备信息");
            string line = Console.ReadLine();
            while (line!="q")
            {
                switch (line)
                {
                    case "start": server.StartServerHandler(); break;
                    case "stop": server.StopServerHandler(); break;
                    case "live": server.StartVideoHandler(); break;
                    case "lives": server.StopVideoHandler(); break;
                    case "cat": server.QueryInfoHandler(); break;
                    case "rec": server.QueryRecordHandler(); break;
                    default:
                        break;
                }
                line = Console.ReadLine();
            }
            Console.ReadKey();
        }
    }
}
